VisualRep

 

 

 

Property

Type

Required

Comment

page

number

yes

Page no. where to put image; 1 for first page, -1 for last page.

posX

number

yes

X position specified in 1/10 millimeters. If the number is positive (200) means that the signature field will be placed 200 units from left edge of the page.

posY

number

yes

Y position specified in 1/10 millimeters.

width

number

yes

 

height

number

yes

 

RGB

number

 

RGB value : three bytes of long; default = 0 (0x00RRGGBB in hex)

images

Array of [Image]

no

 

texts

Array of [Text]

no

 

 

 

Example: Visual presentaion of the digital signature in PDF
Sample document has two pages. Let's look at the example, where the field (in which will be placed the signatue) will be placed on the first page of the document.

 

 

...

  var visual = proXSign.VisualRep();

  visual.page = 1; //the signature will be shown on the first page of the document
  visual.posX = 250; //distance from the left edge of the page for 140mm 
  visual.posY = 2900; //deviation round Y koordinate (bottom eadge of the page) for 290 mm
  visual.width = 550; //width of the signature field
  visual.height = 320; //height of the signature field
  visual.rgb = proXSign.RGB(red,green,blue);
 

...

 

 

The next example explains how to add the LOGO and some text to the visualisation.

...

  //picture in binary code
  var encImg="...."; //jpeg, jpg image in Base64 format

  //tell where the picture will appear on the signature field
  visual.posX = 12; //represents the distance from the left edge of the field for 1,2 mm
  visual.posY = 5; //represents the distance from the top edge of the field for 0,5 mm
  //set the picture
 var slikca1 = proXSign.Image();

 slikca1.image = encImg;

 slikca1.posX = 100;

 slikca1.posY = 100;

   //show the picture which will be 10 x 10 mm
 visual.images= [slikca1]; 

  //tell where in the signature field will be the name of the subject
  visual.posX = 100; //represents the distance from the left edge of the signature field for 10 mm
  visual.posY = 150; //represents the distance from the top edge of the signature field for 5 mm 

 

  //add text

   var tekst1 = proXSign.Text("Test Signature", 220, 12, 25, "Tahoma", [proXSign.fontFlags.RegularFont]);

 

   var tekst2 = proXSign.Text();

   tekst2.posX = 220;

   tekst2.posY = 50;

   tekst2.fontSize = 22;

   tekst2.fontFace = "Lucida Sans Unicode";

   tekst2.fontFlags = [proXSign.fontFlags.BoldFont, proXSign.fontFlags.RegularFont];

   tekst2.text = "proXSign v2.0.0";

          

   visual.texts = [tekst1,tekst2];
 

...